package com.coolweather.android.application;

import android.app.Application;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.coolweather.android.service.AutoUpdateService;

import org.litepal.LitePalApplication;

/**
 * Created by Administrator on 2017/7/25.
 */

public class CoolApplication extends Application {

    private static Context context;
    public static final String apiKey = "247f92b234ab4b9fbe220d671cefde87";
    @Override
    public void onCreate() {
        super.onCreate();
        // 程序创建的时候执行
        context = getApplicationContext();
        //LitePal数据库的初始化
        LitePalApplication.initialize(context);
    }

    // 程序终止的时候执行

    @Override
    public void onTerminate() {
        super.onTerminate();
        //停止服务
    }

    public static Context getContext(){
        return context;
    }
    //得到天气的url
    public static String  getWeatherUrl(String weatherId){
        return "http://guolin.tech/api/weather?cityid=" + weatherId + "&key=247f92b234ab4b9fbe220d671cefde87";
    }
}
